package com.armani.mapper;

import com.armani.entity.Pay;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @ProjectName: armani
 * @Package: com.armani.mapper
 * @ClassName: PayMapper
 * @Description: TODO
 * @Author: Roc
 * @Date: 2021/11/28 18:10
 * @Version: 1.0
 **/
public interface PayMapper {
    /**
     * 查询列表
     * @param userId
     * @param state
     * @param startRow
     * @param limit
     * @return
     */
    List<Pay> ListSearch(@Param(value = "userId") Integer userId,

                         @Param(value = "state")Integer state,
                         @Param(value = "startTime") String startTime,
                         @Param(value = "endTime")String endTime,
                         @Param(value = "startRow")Integer startRow,
                         @Param(value = "limit")Integer limit );

    /**
     * 获取总条数
     * @param userId
     * @param state
     * @return
     */
    Integer getCount(@Param(value = "userId") Integer userId,
                     @Param(value = "state")Integer state,
                     @Param(value = "startTime") String startTime,
                     @Param(value = "endTime")String endTime);

    /**
     * 添加
     * @param userId
     * @param orderId
     * @param payTime
     * @param payment
     * @param payway
     * @param state
     * @return
     */
    Integer insert(@Param(value = "userId") Integer userId,
                   @Param(value = "orderId")Integer orderId,
                   @Param(value = "payTime")Date payTime,
                   @Param(value = "payment")  BigDecimal payment,
                   @Param(value = "payway")Integer payway,
                   @Param(value = "state")Integer state);

    /**
     * 修改
     * @param userId
     * @param orderId
     * @param payTime
     * @param payment
     * @param payway
     * @param state
     * @param id
     * @return
     */
    Integer update(@Param(value = "userId") Integer userId,
                   @Param(value = "orderId")Integer orderId,
                   @Param(value = "payTime")Date payTime,
                   @Param(value = "payment")  BigDecimal payment,
                   @Param(value = "payway")Integer payway,
                   @Param(value = "state")Integer state,
                   @Param(value = "id") Integer id);

    /**
     * 删除
     * @param id
     * @return
     */
    Integer delete(@Param(value = "id") Integer id);
}
